package io.lvdaxian.handwriting.lambda;

import io.lvdaxian.handwriting.functional.ThrowExceptionFunction;
import org.junit.Test;

/**
 * lambda ThrowExceptionFunction 测试案例
 *
 * @author lihh
 */
public class ThrowExceptionFunctionTest {
  
  public static ThrowExceptionFunction isTrue(boolean flag) {
    return (message) -> {
      if (flag) {
        throw new RuntimeException(message);
      }
    };
  }
  
  @Test
  public void testCase001() {
    ThrowExceptionFunctionTest.isTrue(true).throwMessage("测试案例");
  }
}
